<template id="consumer_details">
	<div class="consumer_details">
		
		<!--头部-->
			<div class="about_header">

				<div class="about_title">
					<router-link :to="{path:'/main_money',query:{money:money}}"><img src="../../assets/images/class/jiantou_03.png" /></router-link>

					<p>消费明细</p>
					<div class="about_select">
						<div class="about_ing"></div>
						

					</div>

				</div>
			</div>
			<!--头部结束-->
			
			<div class="consumer_most">
				<ul>
					<li v-for = "(item,index) in myMoney" :key="index">
						<div class="consumer_fund">
							<div class="consumer_left">
								<p>{{username}}</p>
								<span>{{item.ctime | formatDate}}</span>
							</div>
							<div class="consumer_right">
								<p>-￥258</p>
							</div>
							
						</div>
					</li>
				
					
					
				</ul>
			</div>
			
		
		
	</div>
</template>

<script>
	export default {
		data() {
			return {
				myMoney: [{
					chang_money: ''
				}],
				sessionid: '',
				coachid: this.$route.query.coachid,
				userid: "",
				code: 1,
				username: "",
				money:'',
			}
		},
		created() {
			var SESSION_ID=JSON.parse(window.localStorage.getItem('sessiond'))
			this.username = SESSION_ID.user.username
			this.money = this.$route.query.money
			let obj = {
				//请求的参数
				sessionid: SESSION_ID.sessionid,
			    userid: SESSION_ID.user.id,
				coachid: this.$route.query.coachid,
				code: 1

			};
			// 饭否官方和
			let _this = this
			let qs = require('qs');
			this.$axios.post("http://yogahome.top/yujia/user/showUserWalletTrancDetailed", qs.stringify(obj), {
				headers: {
					'Content-Type': 'application/x-www-form-urlencoded'
				}

			}).then((response) => {

				_this.myMoney = response.data.data

			}).catch(function(error) {
				console.log(error);
			});
		},
		filters: {
      formatDate: function (value) {
        let date = new Date(value);
        let y = date.getFullYear();
        let MM = date.getMonth() + 1;
        MM = MM < 10 ? ('0' + MM) : MM;
        let d = date.getDate();
        d = d < 10 ? ('0' + d) : d;
        let h = date.getHours();
        h = h < 10 ? ('0' + h) : h;
        let m = date.getMinutes();
        m = m < 10 ? ('0' + m) : m;
        let s = date.getSeconds();
        s = s < 10 ? ('0' + s) : s;
        return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
      },
    },
		methods: {

		}
	}
</script>

<style scoped>
	@import "../../assets/css/consumer_details.css";
</style>